﻿<%@ WebHandler Language="C#" Class="Brand_GetAll" %>

using System;
using System.Web;
using System.Collections;
using System.Collections.Generic;
using System.Text;
using Newtonsoft.Json;

public class Brand_GetAll : IHttpHandler, System.Web.SessionState.IReadOnlySessionState  
{
    
    public void ProcessRequest (HttpContext context) 
    {
        //检验是否登录
        if (!OTS.BaseLogin.validataModule(context, (int)OTS.enumSysRight.BrandManager))
        {
            context.Response.ContentType = "text/json";
            context.Response.Write("非法操作！");
            return;
        }

        OTS.Common.Page<OTS.Model.Brand> page = new OTS.Common.Page<OTS.Model.Brand>();
        OTS.BLL.BrandBLL bll = new OTS.BLL.BrandBLL();
        List<OTS.Model.Brand> list = bll.GetAllList();
        page.root = list;
        page.success = true;
        page.totalProperty = bll.getSqlRecodeCount("");
        page.limit = 100;
        page.start = 0;
        context.Response.ContentType = "text/json";
        context.Response.Write(JavaScriptConvert.SerializeObject(page));
    }
 
    public bool IsReusable {
        get {
            return false;
        }
    }

}